package com.kuang.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//conponent组件 等价于<bean id="user" class="com.kuang.pojo.User"/>
@Component
@Scope("singleton")
public class User {

    public String name;

    @Value("人民日报") //相当于<propery name="name" value="日民日报"/>
    public void setName(String name){
        this.name = name;
    }
}
